package com.ruifu.bom.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fhzncloud.cloud.common.security.service.CloudUser;
import com.ruifu.bom.dto.MaterielAndVersionsDTO;
import com.ruifu.bom.vo.MaterielAndVersionsVO;
import com.ruifu.common.po.MaterielVersions;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 物料持久层
 *
 * @author nyr
 * @create 2019/11/25
 */
@Mapper
public interface MaterielVersionsMapper extends BaseMapper<MaterielVersions> {
    /**
     * 物料版本/物料联合查询
     * @return
     * @param page
     * @param materielAndVersionsDTO
     * @param cloudUser
     */
    List<MaterielVersions> findByQuery(@Param("page") Page<MaterielAndVersionsVO> page,
                                       @Param("materielAndVersionsDTO") MaterielAndVersionsDTO materielAndVersionsDTO, @Param("cloudUser") CloudUser cloudUser);

    /**
     * 根据物料版本id查询物料详情
     * @param mvId
     * @return
     */
    MaterielVersions findByMvId(String mvId);
}
